/***************************************************************************************
****************************************************************************************
* FILE		: battery.h
* Description	: 
*			  
* Copyright (c) 2020 by Simlife. All Rights Reserved.
* 
* History:
* Version		Name		Date				Description
   0.1		Alen			2020/10/26		Initial Version
   
****************************************************************************************
****************************************************************************************/

#ifndef _BT_H_
#define _BT_H_

#define wifiControlPort _pc
#define wifiControlPortAndPin _pc6
#define wifiControlPin PIN_6
#define wifiControlPinReverse PIN_6_REVERSE
#define wifiControlTypeControl _pcc
#define wifiControlPullUpControl _pcpu

#define wifi_ON() (wifiControlPortAndPin = 1)
#define wifi_OFF() (wifiControlPortAndPin = 0)


typedef enum
{
	START,
	DATA,
	END,
} BT_RESTATE;

typedef enum
{
	KEY_COMMAND = 0x01,
	CHECK_COMMAND = 0x02,
	WAKE_COMMAND = 0x03,
	OFF_COMMAND = 0x04,

	MODE_COMMAND = 0x05,

} BT_COMMAND;

extern void sendTestBuf(void);
extern void sendModulePowerOff(void);

extern void initWifiControlPin(void);
extern void closeWifiControlPin(void);
extern void closeUARTPin(void);
extern void send_command_to_bt(BT_COMMAND bt_command, U8 *body_buf);
extern void bt_data_send_automatic(void);
extern void bt_receive_data_process(void);


#endif